import request from '@/utils/request'
import { remoteRequest } from '@/utils/remote'

// 查询列表
export function listHouse(id) {
  return request({
    url: '/fxfzaqbz/data/getAidedAnalyseByIaId/' + id,
    method: 'get',
  })
}

// 查询详细
export function getFzfx(id) {
  return request({
    url: '/fxfzaqbz/data/getAidedAnalyseById/' + id,
    method: 'get'
  })
}

// 上传
export function uploadHouse(data) {
  return request({
    url: '/fxfzaqbz/data/saveAidedAnalyse',
    method: 'post',
    data: data
  })
}

// 上传多个
export function uploadHouseList(data) {
  return request({
    url: '/fxfzaqbz/data/saveAidedAnalyses',
    method: 'post',
    data: data
  })
}

// 上传图片
export function uploadHousePic(data) {
  return request({
    url: '/attachment/uploadFile',
    method: 'post',
    data: data
  })
}

// 修改
export function updateHouse(data) {
  return request({
    url: '/fxfzaqbz/data/updateAidedAnalyse',
    method: 'post',
    data: data
  })
}

// 删除
export function delHouse(id) {
  return request({
    url: '/fxfzaqbz/data/delAidedAnalyse/' + id,
    method: 'post'
  })
}

// 提交最终成果
export function firstSubmitDisasterAss(id) {
  return request({
    url: '/fxfzaqbz/data/submitResult?id=' + id,
    method: 'post',
  })
}

// 标题是否重复
export function titleCheck(data) {
  return remoteRequest('titleCheck', data, () => {
    return request({
      url: '/fxfzaqbz/data/check',
      method: 'post',
      data: data
    })
  })
}

// 查询最终成果列表
export function listHouses(id) {
  return request({
    url: '/fxfzaqbz/data/getByIaId/' + id,
    method: 'get',
  })
}

// 编辑描述
export function updataDescribe(data) {
  return request({
    url: '/fxfzaqbz/data/saveDescription',
    method: 'post',
    data: data
  })
}

// 移除数据
export function removeDisasterAss(id) {
  return request({
    url: '/fxfzaqbz/data/removeResult?id=' + id,
    method: 'post',
  })
}

// 提交
export function secondSubmitDisasterAss(ids) {
  return request({
    url: '/fxfzaqbz/data/finalSubmission/' + ids,
    method: 'post',
  })
}

// 查询列表
export function listPic() {
  return request({
    url: '/fxfzaqbz/data/getSupergraph',
    method: 'get',
  })
}

// 出图
export function outPic(data) {
  return request({
    url: '/fxfzaqbz/data/supergraph',
    method: 'post',
    data: data
  })
}